﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SLControlLibrary.Resources.Common.Converters
{
    public class BooleanToVisibilityConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool _Temp = (bool)value;

            if (_Temp)
                return Visibility.Visible;
            else
                return Visibility.Collapsed;
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Visibility _Temp = (Visibility)value;

            if (_Temp == Visibility.Visible)
                return true;
            else if (_Temp == Visibility.Collapsed)
                return false;
            else
                return false;
        } 
    }
}
